/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __MOON_H__
#define __MOON_H__

#include "SkyLight.h"

namespace PQEngine
{
	/*Simulate the moon
	*/
	class Moon
		: public SkyLight
    {
	public:
		static const Ogre::String MATERIAL_NAME;
		static const Ogre::String ENTITY_NAME;
		static const Ogre::String MESH_NAME;
		static const Ogre::String Moon::MATERIAL_BACKGROUND_NAME;

	public:
		Moon(SceneObject* sceneObject);

		void update(const Ogre::Vector3& direction,const Ogre::ColourValue &lightColor,const Ogre::ColourValue &bodyColor);
		/// Set the moon's phase
		void setPhase(Ogre::Real phase);

	private:
		void initMaterial();
		void initBillboards();
	private:
		Ogre::Entity* _entity;//sun entity
		Ogre::SceneNode* _sceneNode;
		Ogre::MaterialPtr _material;
		Ogre::MaterialPtr _backgroundMaterial;

		Ogre::BillboardSet* _moonBillboards;
		Ogre::BillboardSet* _backgroundBillboards;
		
	};
}
#endif
